<template>
  <div class="mydata">
    <mt-header fixed title="个人信息">
      <router-link to="/user-setting" slot="left">
        <mt-button icon="back"></mt-button>
      </router-link>
    </mt-header>
    <div style="height: .8rem"></div>
    <mt-cell :to="{path:'/user-mydataitem',query: {type: 'img'}}" class="border-bottom" title="头像" is-link>
      <img class="mydata-img" :src="list.img" alt="">
    </mt-cell>
    <mt-cell :to="{path:'/user-mydataitem',query: {type: 'wxImg'}}" class="border-bottom" title="微信二维码" value="上传" is-link></mt-cell>
    <mt-cell class="border-bottom" title="我的ID" :value="list.personalCode"></mt-cell>
    <mt-cell :to="{path:'/user-mydataitem',query: {type: 'nickName'}}" class="border-bottom" title="昵称" :value="list.nickName" is-link></mt-cell>
    <mt-cell :to="{path:'/user-mydataitem',query: {type: 'wechat'}}" class="border-bottom" title="微信" :value="list.wechat" is-link></mt-cell>
    <mt-cell :to="{path:'/user-mydataitem',query: {type: 'qq'}}" class="border-bottom" title="QQ" :value="list.qq" is-link></mt-cell>
    <div style="height:.3rem"></div>
    <mt-cell :to="{path:'/user-mydataitem',query: {type: 'trueName'}}" class="border-bottom" title="真实姓名" :value="list.trueName" is-link></mt-cell>
    <mt-cell :to="{path:'/user-mydataitem',query: {type: 'sex'}}" class="border-bottom" title="性别" :value="list.sex" is-link></mt-cell>
    <mt-cell :to="{path:'/user-mydataitem',query: {type: 'birthday'}}" class="border-bottom" title="生日" :value="list.birthday" is-link></mt-cell>
    <mt-cell :to="{path:'/user-mydataitem',query: {type: 'occupation'}}" class="border-bottom" title="职业" :value="list.occupation" is-link></mt-cell>
  </div>
</template>

<script>
import axios from 'axios'
export default {
  name: 'MyData',
  data () {
    return {
      value: false,
      val: false,
      list: []
    }
  },
  mounted () {
    axios.get('/meimai/interface/member/getProfileData', {
      params: {
        memberId: this.$store.state.userId
      }
    }).then((res) => {
      let datas = res.data
      if (datas.code === 0) {
        console.log(datas)
        this.list = datas.data
      }
    })
  }
}
</script>

<style lang="stylus" scoped>
.mint-header
  background: #ec2935
.mydata
  position: absolute
  width: 100%
  top: 0
  bottom: 0
  background-color: #f8f8f8
  .mydata-img
    width: .8rem
    height: .8rem
    border-radius: 50%
</style>
